/*
 * @Author: haijun
 * @Date: 2022-08-22 14:52:04
 * @Last Modified by: whj
 * @Last Modified time: 2022-08-22 16:00:20
 */
import request from '@/utils/request'

export function getDepartmentsApi() {
  return request({
    url: '/company/department',
  })
}

/** *
 *  根据id根据部门  接口是根据restful的规则设计的   删除 delete  新增 post  修改put 获取 get
 * **/

/**
 * 删除部门接口
 * @param {部门} id
 * @returns promise
 */
export function delDepartmentsApi(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete',
  })
}

/**
 *  新增部门接口
 *
 * ****/
export function addDepartmentsApi(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data,
  })
}
